xen: arm: correctly handle sysreg accesses from userspace
authorIan Campbell <ian.campbell@citrix.com>
Mon, 30 Mar 2015 11:12:31 +0000 (12:12 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 31 Mar 2015 08:42:53 +0000 (09:42 +0100)
commit63870015972aba7d8877716080d5bc09ce6758d5
treebd82057b6db69710ec6b7600eac462df0b8abfdd
parentedcbee5a5d66f0faf159f29a39dcc49c6856ad84
xen: arm: correctly handle sysreg accesses from userspace

Previously we implemented all registers as RAZ/WI even if they
shouldn't be accessible to userspace.

It is not entirely clear whether attempts to access *_EL1 registers
from EL0 will trap to EL1 or EL2, be conservative and treat as an
undef injection.

PMUSERENR_EL0 and MDCCSR_EL0 are R/O to EL0. MDCCSR_EL0 was previously
not handled at all.

Other PM*_EL0 registers are accessible at EL0 only if PMUSERENR_EL0.EN
is set, since we emulate that as RAZ/WI we know that bit cannot be
set.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/traps.c
xen/include/asm-arm/sysregs.h